#include "stdafx.h"
#include "LogTargetConsole.h"
#include <iostream>

namespace woe
{
	LogTargetConsole::LogTargetConsole()
	{}

	LogTargetConsole::~LogTargetConsole()
	{}

	bool LogTargetConsole::initialize()
	{
		return  true;
	}
	
	void LogTargetConsole::doLog(const string& msg, const string& ll, const TimeStamp& ts)
	{
#ifdef UNICODE
		std::wostream& out = std::wcout;
#else
		std::ostream& out = std::cout;
#endif
		if (out.good())
		{
			string tm_fmt;
			ts.format(tm_fmt);
			out<<tm_fmt<<" - "<<ll<<"> "<<msg<<std::endl;
		}
	}
}
